<template>
	<view>
		<custom-navigation-bar title="合伙人后台"></custom-navigation-bar>
		<view class="top">
			
		</view>
		<view class="menu_item" @click="application()">
			<view class="menu_item_1" style="text-align: center;">
				区域申请
			</view>
		</view>
		<view style="width: 100%;float: left;margin-top: 20rpx;"></view>
		<view class="menu_item" v-for="(item,index) in list" :key="index" style="height: auto;" @click="get(item)">
			<view class="menu_item_1" >
				{{item.province}}{{item.city}}{{item.district}}
				<text style="float: right;font-size: 22rpx;" v-if="item.status==0">待审核</text>
				<text style="float: right;font-size: 22rpx;" v-if="item.status==1">正常</text>
				<text style="float: right;font-size: 22rpx;" v-if="item.status==2">审核失败</text>
			</view>
			<view v-if="item.status==2" style="width: 86%;height: auto;float: left;margin-left: 7%;line-height: 20rpx;margin-bottom: 20rpx;">
				{{item.message}}
			</view>
		</view>
	</view>
</template>

<script setup> 
	import CustomNavigationBar from '@/components/CustomNavigationBar.vue'
	import http from '../../../utils/http';
	const list=ref([]);
	function application(){
		uni.navigateTo({
			url:"/pages/application/form_citypartner"
		})
	}
	function get(item){
		if(item.status==1){
			uni.navigateTo({
				url:"/pages/my/partner/index?id="+item.id
			})
		} 
	}
	function initList(){
		http.request({
			url: "/X/application/cityPartner/list",
			method: "POST",
			data: {
				userId:getApp().globalData.user.userId
			}
		}).then((responseData) => {  
			if(responseData.code==1){
				list.value=responseData.data;
				   
			}else if(responseData.code==-1){
				uni.navigateTo({
					url: "/pages/login/login"
				});
			}  
		}).catch((err) => {
			uni.showToast({
				icon: 'error',
				title: '请求失败'
			});
			uni.hideLoading();
	   })
	} 
	initList();
</script>

<style>
	.menu_item_2{
		width: 84%;margin-left: 8% ;height: 80rpx;line-height: 80rpx;float:left;text-align: center;font-size: 30rpx;font-weight: bold;
	}
	.menu_item_img{
		width: 40rpx;height: 40rpx;float: right;margin-top: 20rpx;
	}
	.menu_item_1{
		width: 84%;margin-left: 8% ;float: left;height: 80rpx;line-height: 80rpx;float:left;font-size:28rpx;font-weight: bold;
	}
	.menu_item{
		width: 100%;float: left;height: 80rpx;line-height: 80rpx;margin-top: 10rpx;background:white;
	}
	Page{
		background-color: #F2F2F2;
		font-size: 30rpx;
	}
	.btn-1{
		width: auto;border: #969696 3rpx solid;color: #969696;border-radius:10rpx;padding-left: 8rpx;padding-right: 10rpx;font-size: 28rpx;margin-left: 10rpx;
	}
	.top{
		width: 100%;height:auto;margin-top: 150rpx;background: #2AE8DC;float: left;font-size: 30rpx;
	}
	.top_1{
		width: 80%;height: 50rpx;line-height: 50rpx;float: left;margin-left: 10%;color: white;
	}
</style>